#!/usr/bin/env python

# (c) 2007-2011 Helsinki University of Technology and University of Helsinki
# Licensed under the MIT license; see LICENSE.txt for more information.

from harava.worker import Worker
from harava.rdf import *
from harava.validate import Validator

import re
import urllib2
import sys


class ToSuVoluntaryValidator (Validator):
  def __init__(self, session):
    Validator.__init__(self, session)

  def process(self, doc):
    # check required fields
    success = True

    # ...add checks here...

    if not success:
      doc.processingFinished()
      return False

    
    doc.setCompleted('validate')
    self._session.schedule(doc)
    return True

  def finish(self):
    # possibly free some memory
    Validator.finish(self)
